<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>NLPK</title>
</head>

<body>
    <div id="app">
        <p>Hello, here is main</p>
    </div>

    <script src="/mockData/employee.js"></script>
    <script src="/js/dictionary/keywords.js"></script>
    <script src="/js/dictionary/nouns.js"></script>
    <script src="/js/dictionary/verbs.js"></script>
    <script src="/js/transpiler.js"></script>

    <script>
    
    console.log('employee', typeof employee);
    transpiler.bootstrap({
        define: define,
    }, {
        employeeList: employeeList,
        monkey: monkey,
    }, verbs);

    // transpiler.boostrap([employeeList], verbs);

    // Create WebSocket connection.
    const socket = new WebSocket('ws://localhost:6200');

    // Connection opened
    socket.addEventListener('open', function (event) {
        socket.send('Hello Server!');
    });

    socket.addEventListener('close', function (event) {
        // hot reload when ws disconnect.
        window.location.reload();
    });

    // Listen for messages
    socket.addEventListener('message', function (event) {
        console.log('Message from server:', event.data);
        transpiler.translate(event.data);
    });
    
    </script>
</body>

</html>